package com.sure.classsystemserver.classroom.query.impl;

import com.sure.classsystemserver.classroom.query.Classroom;
import com.sure.classsystemserver.classroom.query.Number;
import com.sure.classsystemserver.classroom.query.QueryService;
import com.sure.classsystemserver.classroom.query.dao.QueryDao;
import com.sure.classsystemserver.classroom.query.QueryDto;
import com.sure.classsystemserver.common.CurrentUser;
import com.sure.classsystemserver.common.Utils;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import javax.annotation.Resource;
import java.util.List;
import java.util.Map;

@Service
@Transactional
public class QueryServiceImpl implements QueryService {
    @Resource
    private QueryDao queryDao;

    @Override
    public Map<String, Object> findFlowrateList(QueryDto queryDto) {
        return Utils.getPage(queryDto,()->queryDao.findFlowrateList(queryDto));
    }

    @Override
    public List<Number> findNumberList(QueryDto queryDto) {
        List<Number> numberList = queryDao.findNumberList(queryDto);
        return numberList;
    }

    @Override
    public List<Classroom> findClassroomList() {
        List<Classroom> classroomList=queryDao.findClassroomList();
        return classroomList;
    }
}
